1. Field of the Invention
This invention relates to computing systems, and more particularly, to reliably using data storage media.
2. Description of the Relevant Art
A variety of products utilize both general-purpose processors and application-specific processors. Examples of these products include desktop computers, servers, cell phones or smart phones, tablet computers, personal digital assistant (PDA) devices, equipment and devices that may include embedded processors for medical applications, automobile applications, home theater applications, and so forth. General-purpose processors access a main memory for data and instructions during the processing of algorithms and methods comprised within software applications. Similarly, application-specific processors access a main memory. The application-specific processors may include single-instruction-multiple-data (SIMD) processors, application-specific integrated circuits (ASICs), digital signal processing chips (DSPs), and so forth.
The main memory may be accessible to one or more processors. Data may be stored in a persistent manner. When power is removed, the persistent data remains stored. When the power is restored, the persistent data may be accessed by the one or more processors and used again. However, data stored in a non-persistent manner is lost when the power is removed and unavailable when the power is restored.
The data stored in a persistent manner is stored on a non-volatile data storage medium, such as hard disk drives (HDDs), solid-state drives (SSDs), and flash memory. These types of storage media utilize large, slow data transfers, which increase access times and reduce performance. Therefore, a memory hierarchy is used to temporarily buffer data in multiple levels of volatile memory, which utilizes relatively smaller and faster data transfers than non-volatile memory. The types of volatile memory include one or more levels of caches and dynamic random access memory (DRAM).
Other types of non-volatile data storage media to use as persistent memory include phase change memory (PCM), spin torque transfer RAM, and memristors. These types of data storage media also utilize relatively smaller and faster data transfers than HDDs, SDDs and flash non-volatile memory. This type of persistent memory may be placed side-by-side with DRAM on a printed circuit board, a printed circuit card, or a silicon die. This type of persistent memory may be available to one or more processors, each processor executing one or more threads.
Store data for a first store (write) operation from a first thread to persistent memory, such as PCM, is observable by other threads. The other threads may be on the same processor and on any other processors. It is possible for a second thread on a same processor or on a different processor to read the store data, update another variable based on the store data, and force the updated variable to be persistent by sending a second store operation to persistent memory. The second store operation may complete prior to completion of the first store operation and cause the updated variable to be made persistent prior to the store data from the first thread is made persistent. Afterward, with the store data from the first thread still not persistent, a power failure or a system reset would cause data corruption since inconsistent data is stored in the persistent memory.
In view of the above, methods and mechanisms for reliably using data storage media are desired.